package acm.广东工业大学新生赛;

import java.util.Scanner;

public class C {
    static int[] res={9,5,3,7}; //结果只有这4种情况*fn-1
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long n = sc.nextInt();
        while (n-- > 0) {
            System.out.println(sc.nextLong() == 1?9:5);
        }
    }
}
